package com.company.nowcoder;

import java.util.Scanner;

public class Main21{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        boolean[] res = new boolean[T];
        for(int i = 0;i < T;i++){
            int N = sc.nextInt();
            int A = sc.nextInt();
            int B = sc.nextInt();
            int C = sc.nextInt();
            res[i] = isDuriodTheseHotDays(N,A,B,C);
        }
        for (int i = 0;i < res.length;i++){
            if(res[i] == true){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }
    }

    private static boolean isDuriodTheseHotDays(int days,int a, int b, int c) {
        return days * 6 == a + 2 * b + 3 * c;
    }
}
